<template>
    <div class="page details page-vehicle-sim-detail">
        <div class="detail-header">
            <p>{{ title }}</p>
        </div>

        <div class="detail-painter">
            <p-painter />
        </div>

        <div class="detail-buttons">
            <el-button class="el-icon-back" type="primary" size="small" @click="handleReturn">
                {{ $t('lang.return') }}
            </el-button>
            <el-button ref="submitBtn" class="el-icon-upload" type="primary" size="small" @click="handleSubmit">
                {{ $t('lang.submit') }}
            </el-button>
        </div>
    </div>
</template>

<script type="text/ecmascript-6">
import * as enums from '../../../store/status-enums.js';
import pPainter from '../../../components/p-painter.vue';
import i18n from '../../../lang/index.js';
const $t = i18n.global.t;

export default {
    name: 'vehicle-sim-detail',
    components: { pPainter },
    data () {
        return {
            status: 'add',
            loading: false,
            form: {},
            rules: {
                id: [{ required: true, message: $t('lang.id') + ' ' + $t('lang.required'), trigger: 'blur' }]
            }
        };
    },
    computed: {
        title() {
            let tit = this.$route.meta.title + ' ';
            tit += $t('lang.detail');
            return tit;
        }
    },
    created() {
        this.init();
    },
    methods: {
        init() {
            console.warn('vehicle-sim-detail.init: ', ...arguments);
        },
        handleReturn() {
            if (this.floaterTag) this.$store.commit(enums.CLOSE_FLOATER);
            else this.$router.go(-1);
        },
        handleSubmit() {
            console.log('vehicle-sim-detail.handleSubmit: ', this.form);
        }
    }
};
</script>

<style lang="scss">
.page-vehicle-sim-detail {
    .detail-painter {
        width: 100%;
        height: 300px;
    }
}
</style>
